
import store from '@/store/index'
import storage from 'store'
import { errorHandler, failHandler } from '@/utils/utils'

const model = {
  getToken: () => storage.get('USERINFO')?.token,
  getUserInfo: () => storage.get('USERINFO'),
  logout: () => {
    store.dispatch('Logout')
  },
  errHandler: (error) => {
    errorHandler(error)
  },
  failHandler: (res) => {
    failHandler(res)
  }
}

export default model
